# -*- coding: utf-8 -*-
import datetime
from typing import Union
from pydantic import BaseModel, Field
from typing import List, Optional
from .common import YgBase
from pydantic.dataclasses import dataclass


class TemplateType(YgBase):
    id: int = Field(None, noneable=True)
    code: str
    name: str
    category: str


class Template(YgBase):
    id: int = Field(None, noneable=True)
    name: str
    config: str
    description: str = Field('', noneable=True)
    template_type_id: int


@dataclass
class column:
    title: str
    width: int
    dataIndex: str
    align: str = ''


@dataclass
class excelData:
    fileName: str
    sheetName: str
    title: str
    subtitle: str
    columns: List[column]
    id_template: int


@dataclass
class excelBySqlData(excelData):
    sql: str


@dataclass
class stringData:
    chunkSize: int
    currentType: str
    inputData: str
    seperator: str
    isMergeSameSpecs: bool